package cn.mazexal.exambg.common.models;

import java.util.Optional;

/**
 * @author: Mazexal
 * Date: 2021/10/1
 */
public class BoolIntVal {

    /**
     * 真
     */
    public static final int True = 1;

    /**
     * 假
     */
    public static final int False = 0;

    /**
     * 忽略
     */
    public static final int Ignore = -1;

    public static int fromBool(Boolean val) {
        return Optional.ofNullable(val).map(t -> t ? True : False).orElse(False);
    }

}
